<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="../js/vue.js"></script>
<style>
    .block{display: inline-block;border: 1px solid;}
</style>
<body>
    <div id="app">
        <div class="block">不阻止默认行为</div>
        <div class="block" v-on:contextmenu.prevent="rightClick">阻止默认行为</div>
    </div>
    <script>
        let app = new Vue({
            el:"#app",
            data:{

            },
            methods:{
                rightClick(){
                    alert("do something");
                }
            }
        })
    </script>
    
</body>
</html>